package com.lsq.tucao.express.client;

import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

@FeignClient(name = "tucao",url = "http://v.juhe.cn/toutiao/index?type=top&key=3dc86b09a2ee2477a5baa80ee70fcdf5")
public interface NewsClient {

    @GetMapping
    JSONObject getTopNews();

    @Slf4j
    @Component
    class NewsClientFallback implements NewsClient {

        @Override
        public JSONObject getTopNews() {
            return null;
        }
    }
}
